<?php
session_start();
if (!isset($_POST['uname']) || !isset($_POST['uname'])){?><script type="text/javascript"> location.href="send.php";</script><?php } 
$user=$_POST['uname'];
$pass=$_POST['pass'];

function msg()
{echo " message goes here";
}

include ("sql.php");
$query="select * from login where uname=\"$user\";";

$result=mysql_query($query);
$row=mysql_fetch_array($result);

if ( strcmp($row[2],$pass)==0){
echo " welcome $row[1] <a href=\"login.php\">back</a>";
$_SESSION['uname']=$user;
?>
<script type="text/javascript"> location.href="send.php";</script><?php }
else { echo "invalid user name or password"; }

?>
